<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>注册</title>
		<script src="__STATIC__/home/js/query-3.0.0.min.js"></script>
		<script src="__STATIC__/home/js/layer/layer.js"></script>
		<script src="__STATIC__/home/js/layui/layui.js"></script>
		<link rel="stylesheet" href="__STATIC__/home/js/layui/css/layui.css">
		<style>
			.container{width:400px;height:400px;border:1px solid #999;box-shadow:5px 5px 30px #666;border-radius:5px;position:absolute;top:50%;left:50%;margin-left:-300px;margin-top:-300px;padding:40px 100px;background:rgba(255,255,255,0.7);background-size:100% 100%;}
			.sub{width:150px;margin:0 auto}
			.layui-form-label{width:120px;}
		</style>
    </head>
    <body style="background:url('__STATIC__/home/img/bg4.jpg') 0 100px no-repeat;">
	<div class="container">
        <form id="form1" action="javascript:void(0);" class="layui-form" method="post">
		  <div class="layui-form-item">
			<label class="layui-form-label"><b>发票抬头：</b></label>
			<div class="layui-input-inline">
			  <input type="text" name="unit" placeholder="必填" required lay-verify="required" class="layui-input">
			</div>
		  </div>
		  <!--一个DIV-->
		  <div class="layui-form-item">
			<label class="layui-form-label"><b>统一社会信用码：</b></label>
			<div class="layui-input-inline">
			  <input type="text" name="code" placeholder="必填" required lay-verify="required" class="layui-input">
			</div>
		  </div>
		  <!--一个DIV-->
		  <div class="layui-form-item">
			<label class="layui-form-label"><b>收件人电话：</b></label>
			<div class="layui-input-inline">
			  <input type="text" name="mobile" placeholder="必填 11位手机号码" id="mobile" onkeyup="value=value.replace(/[^\d]/g,'')" maxlength="11"  required lay-verify="required|mobile" class="layui-input">
			</div>
		  </div>
		  <div class="layui-form-item">
			<label class="layui-form-label"><b>座机(非必填)：</b></label>
			<div class="layui-input-inline">
			  <input type="text" id="phone" lay-verify="phone" name="phone"  class="layui-input">
			</div>
		  </div>
		  <!--一个DIV-->
		  <div class="layui-form-item">
			<label class="layui-form-label"><b>地址：</b></label>
			<div class="layui-input-inline">
			  <input type="text" name="addres" placeholder="必填" required lay-verify="required" class="layui-input">
			</div>
		  </div>
		  <!--一个DIV-->
		  <div class="layui-form-item">
			<label class="layui-form-label"><b>收件人：</b></label>
			<div class="layui-input-inline">
			  <input type="text" name="app_name" placeholder="必填" required lay-verify="required" class="layui-input">
			</div>
		  </div>
		  <!--一个DIV-->
            <div style="width:100%;padding:0 125px;margin:20px 0;"><input type="submit"  lay-filter="formDemo" lay-submit="" class="layui-btn sub" value="提交"></div>
			<p style="color:#4490c1;font-size:12px;text-align:center;"><b>请务必准确填写上述信息并支付费用，我们在会议结束后，根据上述信息将发票快递给贵单位</b></p>
        </form>
		
		</div>
    </body>
	<script>
	layui.use('form', function(){
  var form = layui.form;
  form.verify({
  //我们既支持上述函数式的方式，也支持下述数组的形式
  //数组的两个值分别代表：[正则匹配、匹配不符时的提示文字]
 mobile: [/^1[3|4|5|7|8]\d{9}$/, '手机必须11位，只能是数字！'],
 phone: function(value){
			if(value != ''){
			  if(value.length != 7){
				return '座机必须是7位数';
			  }
			}
		}
});
  //监听提交
  form.on('submit(formDemo)', function(data){
    
	var url = "{:url('enrol')}",data = $('#form1').serialize();
	$.post(url,data,function(msg){
		if(msg.code == 1){
			window.location.href="{:url('index/index/qrcode')}";
		}
	})
    return false;
  });
});


	</script>
</html>